import type { selectReq, selectResp } from './type'
import { useHttp } from './useHttp'

export function getSurveyInfo(activeNo: string, params?: any) {
  const config = useRuntimeConfig()
  const baseApi = config.public.baseApi
  const service = 'srvdaq_activity_cfg_wj_select'
  const url = `${baseApi}/daq/select/${service}`
  const req = {
    serviceName: service,
    colNames: ['*'],
    condition: [],
    page: { pageNo: 1, rownumber: 10 },
    query_source: 'list_page',
  }
  if (activeNo) {
    req.condition.push({ colName: 'activity_no', ruleType: 'eq', value: activeNo })
  }
  if (params?.condition?.length) {
    req.condition.push(...params.condition)
  }
  return useHttp.post(url, req).then((res) => {
    console.log(res)

    return res.data
  })
}
